<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles"%>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">

<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="DATAisUS Admin Panel" />
<meta name="author" content="" />

<title>${message}</title>

<link rel="stylesheet" href="<c:url value="/assets/js/jquery-ui/css/no-theme/jquery-ui-1.10.3.custom.min.css"/>">
<link rel="stylesheet" href="<c:url value="/assets/css/font-icons/entypo/css/entypo.css"/>">
<link rel="stylesheet" href="<c:url value="/assets/css/font-icons/font-awesome/css/font-awesome.min.css"/>">
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Noto+Sans:400,700,400italic">
<link rel="stylesheet" href="<c:url value="/assets/css/bootstrap.css"/>">
<link rel="stylesheet" href="<c:url value="/assets/css/neon-core.css"/>">
<link rel="stylesheet" href="<c:url value="/assets/css/neon-theme.css"/>">
<link rel="stylesheet" href="<c:url value="/assets/css/neon-forms.css"/>">
<link rel="stylesheet" href="<c:url value="/assets/css/custom.css"/>">
<link rel="stylesheet" href="<c:url value="/assets/css/white.css"/>">
<link rel="stylesheet" href="<c:url value="/assets/css/override.css"/>">
<link rel="stylesheet" href="<c:url value="/assets/css/fonts.css"/>">
 <link rel="stylesheet" href="<c:url value="/assets/css/common.css"/>">
<script src="<c:url value="/assets/js/jquery-1.11.0.min.js"/>"></script>

<!--[if lt IE 9]><script src="<c:url value="/assets/js/ie8-responsive-file-warning.js"/>"></script><![endif]-->

<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
    <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
<script type="text/javascript">
	function toggleFullScreen() {
		if (document.fullscreenEnabled || document.webkitFullscreenEnabled
				|| document.msFullscreenEnabled
				|| document.mozFullScreenEnabled) {
			if ((document.fullScreenElement && document.fullScreenElement !== null)
					|| (!document.mozFullScreen && !document.webkitIsFullScreen && !document.msFullscreenElement)) {
				if (document.documentElement.requestFullScreen) {
					document.documentElement.requestFullScreen();
				} else if (document.documentElement.mozRequestFullScreen) {
					document.documentElement.mozRequestFullScreen();
				} else if (document.documentElement.webkitRequestFullScreen) {
					document.documentElement
							.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT);
				} else if (this.msRequestFullscreen) {
					this.msRequestFullscreen();
				}
			} else {
				if (document.cancelFullScreen) {
					document.cancelFullScreen();
				} else if (document.mozCancelFullScreen) {
					document.mozCancelFullScreen();
				} else if (document.webkitCancelFullScreen) {
					document.webkitCancelFullScreen();
				} else if (document.msExitFullscreen) {
					document.msExitFullscreen();
				}
			}
		} else {
			alert("Your browser does not support the fullscreen API.");
		}
	}
</script>

<!--- - jqwidgets CSS & JS Files- -->

<link rel="stylesheet"	href="<c:url value="/assets/jqwidgets/styles/jqx.base.css"/>"
	type="text/css" />
<script type="text/javascript"	src="<c:url value="/assets/jqwidgets/jqxcore.js"/>"></script>
<script type="text/javascript"	src="<c:url value="/assets/jqwidgets/jqxdatetimeinput.js"/>"></script>
<script type="text/javascript"	src="<c:url value="/assets/jqwidgets/jqxcalendar.js"/>"></script>
<script type="text/javascript"	src="<c:url value="/assets/jqwidgets/jqxtooltip.js"/>"></script>
<script type="text/javascript"	src="<c:url value="/assets/jqwidgets/jqxdata.js"/>"></script>
<script type="text/javascript"	src="<c:url value="/assets/jqwidgets/jqxbuttons.js"/>"></script>
<script type="text/javascript"	src="<c:url value="/assets/jqwidgets/jqxscrollbar.js"/>"></script>
<script type="text/javascript"	src="<c:url value="/assets/jqwidgets/jqxdatatable.js"/>"></script>
<script type="text/javascript"	src="<c:url value="/assets/jqwidgets/jqxcheckbox.js"/>"></script>
<script type="text/javascript"	src="<c:url value="/assets/jqwidgets/jqxlistbox.js"/>"></script>
<script type="text/javascript"	src="<c:url value="/assets/jqwidgets/jqxdropdownlist.js"/>"></script>
<script type="text/javascript"	src="<c:url value="/assets/jqwidgets/jqxmenu.js"/>"></script>
<script type="text/javascript"	src="<c:url value="/assets/jqwidgets/jqxgrid.js"/>"></script>
<script type="text/javascript"	src="<c:url value="/assets/jqwidgets/jqxgrid.sort.js"/>"></script>
<script type="text/javascript"	src="<c:url value="/assets/jqwidgets/jqxinput.js"/>"></script>
<script type="text/javascript"	src="<c:url value="/assets/jqwidgets/jqxgrid.pager.js"/>"></script>
<script type="text/javascript"	src="<c:url value="/assets/jqwidgets/jqxgrid.selection.js"/>"></script>
<script type="text/javascript"	src="<c:url value="/assets/jqwidgets/jqxgrid.filter.js"/>"></script>
<script type="text/javascript"	src="<c:url value="/assets/jqwidgets/jqxpanel.js"/>"></script>
<script type="text/javascript"	src="<c:url value="/assets/jqwidgets/jqxgrid.grouping.js"/>"></script>
<script type="text/javascript"	src="<c:url value="/assets/jqwidgets/jqxgrid.columnsresize.js"/>"></script>
<script type="text/javascript"	src="<c:url value="/assets/jqwidgets/jqxgrid.columnsreorder.js"/>"></script>
<script type="text/javascript"	src="<c:url value="/assets/jqwidgets/jqxdata.export.js"/>"></script>
<script type="text/javascript"	src="<c:url value="/assets/jqwidgets/jqxgrid.export.js"/>"></script>
<script type="text/javascript"	src="<c:url value="/assets/jqwidgets/jqxgrid.aggregates.js"/>"></script>
<script type="text/javascript"	src="<c:url value="/assets/jqwidgets/globalization/globalize.js"/>"></script>
<script type="text/javascript"	src="<c:url value="/assets/scripts/demos.js"/>"></script>
<script type="text/javascript"	src="<c:url value="/assets/jqwidgets/jqxtreegrid.js"/>"></script>
<script type="text/javascript"	src="<c:url value="/assets/scripts/knockout-3.0.0.js" />"></script>
<script type="text/javascript"	src="<c:url value="/assets/jqwidgets/jqxchart.js" />"></script>
<script type="text/javascript"	src="<c:url value="/assets/js/common.js" />"></script>
<%-- <script type="text/javascript"	src="<c:url value="/assets/js/ezops/profitlossreport.js" />"></script> --%>
<script type="text/javascript"	src="<c:url value="/assets/js/ezops/menu.js" />"></script>
<script type="text/javascript"	src="<c:url value="/assets/jqwidgets/jqxgrid.edit.js"/>"></script>
<script type="text/javascript"	src="<c:url value="/assets/jqwidgets/jqxknockout.js"/>"></script>
<script type="text/javascript"	src="<c:url value="/assets/jqwidgets/jqxwindow.js"/>"></script>
<script type="text/javascript"	src="<c:url value="/assets/jqwidgets/jqxmenu.js"/>"></script>
<script type="text/javascript" src="<c:url value="/assets/jqwidgets/jqxtabs.js"/>"></script>
<script type="text/javascript" src="<c:url value="/assets/jqwidgets/jqxcombobox.js"/>"></script>
</head>
<body class="page-body" onLoad="loadForms()">
	<div class="alert alert-fixed">
		<span></span>
		<button type="button" class="close">x</button>
	</div>
	<div class="page-container white page-left-in">
		<tiles:insertAttribute name="menu" />
		<div class="main-content">
			<tiles:insertAttribute name="header" />
			<hr />
			<tiles:insertAttribute name="body" />
			<tiles:insertAttribute name="footer" />
		</div>
		<!-- Site Footer -->
	</div>
	<tiles:insertAttribute name="modalbody" />
	<!-- including upload form -->
	<div id="loadUploadForms"></div>
	<link rel="stylesheet" href="<c:url value="/assets/js/daterangepicker/daterangepicker-bs3.css"/>">
	<link rel="stylesheet" href="<c:url value="/assets/js/rickshaw/rickshaw.min.css"/>">
	<script src="<c:url value="/assets/js/rickshaw/vendor/d3.v3.js"/>"></script>
	<script src="<c:url value="/assets/js/rickshaw/rickshaw.min.js"/>"></script>
	<script src="<c:url value="/assets/js/jquery.sparkline.min.js"/>"></script>
	<link rel="stylesheet" href="<c:url value="/assets/css/themes/base/jquery.ui.all.css" /> ">
	<script src="<c:url value="/assets/js/ui/jquery.ui.core.js" /> "></script>
	<script src="<c:url value="/assets/js/ui/jquery.ui.widget.js" /> "></script>
	<script src="<c:url value="/assets/js/ui/jquery.ui.mouse.js" />"></script>
	<script src="<c:url value="/assets/js/ui/jquery.ui.sortable.js" />"></script>
	<!-- Bottom Scripts -->
	<script src="<c:url value="/assets/js/gsap/main-gsap.js"/>"></script>
	<script	src="<c:url value="/assets/js/jquery-ui/js/jquery-ui-1.10.3.minimal.min.js"/>"></script>
	<script	src="<c:url value="/assets/js/jquery-ui/js/jquery-ui-1.10.3.custom.js"/>"></script>
	<script src="<c:url value="/assets/js/bootstrap.js"/>"></script>
	<script src="<c:url value="/assets/js/joinable.js"/>"></script>
	<script src="<c:url value="/assets/js/neon-custom.js"/>"></script>
	<script src="<c:url value="/assets/js/resizeable.js" />"></script>
	<%-- <script src="<c:url value="/assets/js/neon-demo.js"/>"></script> --%>
	<script src="<c:url value="/assets/js/neon-api.js"/>"></script>
	<script src="<c:url value="/assets/js/highcharts/highcharts.js"/>"></script>
	<script src="<c:url value="/assets/js/highcharts/drilldown.js"/>"></script>
	<script src="<c:url value="/assets/js/highcharts/data.js"/>"></script>
	<script src="<c:url value="/assets/js/exporting.js"/>"></script>
	<script src="<c:url value="/assets/js/daterangepicker/moment.min.js"/>"></script>
	<script	src="<c:url value="/assets/js/daterangepicker/daterangepicker.js"/>"></script>
	<link rel="stylesheet" type="text/css" media="all" href="<c:url value="/assets/js/daterangepicker/daterangepicker-bs3.css" />" />
	<script type="text/javascript" src="<c:url value="/assets/js/daterangepicker/moment.js"/>"></script>
	<script type="text/javascript" src="<c:url value="/assets/js/daterangepicker/daterangepicker.js" />"></script>
	<script type="text/javascript">
		var sufflechk = false;
		var mx = 0;
		var my = 0;
		function suffleChktoggle(e) {
			e = e || window.event;
			mx = e.pageX;
			my = e.pageY;

		}

		function suffleChktoggleUp(e) {
			e = e || window.event;
			var umx = e.pageX;
			var umy = e.pageY;
			if (mx != umx && my != umy)
				sufflechk = true;
		}
		function loadForms() {
			$("#loadUploadForms").load(ezopsContextPath+'/UploadForm');
			//console.log("Forms loaded");

		}

		$(".dropdown dt a").on('click', function() {
			$(".dropdown dd ul").slideToggle('fast');
		});

		$(".dropdown dd ul li a").on('click', function() {
			$(".dropdown dd ul").hide();
		});
		function getSelectedValue(id) {
			return $("#" + id).find("dt a span.value").html();
		}

		$(document).bind('click', function(e) {
			var $clicked = $(e.target);
			if (!$clicked.parents().hasClass("dropdown"))
				$(".dropdown dd ul").hide();
		});

		$(document).ready(function() {
			$('.reportFilter input[type="checkbox"]').on('click', function() {

				var panelId = $(this).val();

				if ($(this).is(':checked')) {
					$('#' + panelId).show('slow');
				} else {
					$('#' + panelId).hide('slow');

				}
			});
		});

		$("#select-values").click(function() {
			var option_all = $(".select1 option:selected").map(function() {
				return $(this).text();
			}).get().join(' ... ');
			//console.log(option_all);
			var heading = 'Selected Mapping: ';
			$('#result').text(heading + option_all);
		});

		$("#select-values1").click(function() {
			var option_all = $(".select3 option:selected").map(function() {
				return $(this).text();
			}).get().join(' ... ');
			//console.log(option_all);
			var heading = 'Selected Mapping: ';
			$('#result1').text(heading + option_all);
		});
		$(document).ready(
				function() {
					// Disable footer links
					$("a.disabled").click(function () {return false;});
					var today = new Date();

					var lastDayOfMonth = new Date(today.getFullYear(), today
							.getMonth(), 0);

				});

		function setDateRangePicker() {
			$('#dateRange').val('Click to select Range...');
			$('#dateRange').daterangepicker({
				/* format : 'MM-DD-YYYY',
				separator : ' to ' */
			});

		}

		window.onbeforeunload = function() {
			console
					.log("---------------------Saving Report Order---------------------------------");
			var num = 0;
			var orderList = new Array();

			if (sufflechk) {

				$("#sortable").find(">li").each(function() {

					num++;
					//console.log("Order------------------" + num
					//+ "------------report-------------"
					//+ $(this).attr("id"));
					var seqObj = new Object();
					seqObj.userId = '${userId}';
					seqObj.category = $(this).attr("id");
					seqObj.sequenceNbr = num;
					seqObj.resourceName = 'Dashboard';

					orderList.push({
						"userId" : '${userId}',
						"category" : $(this).attr("id"),
						"sequenceNbr" : num,
						"resourceName" : "Dashboard"
					});
					$.ajax({
						url : ezopsContextPath + '/saveUserPreference',
						data : ko.toJSON(seqObj),
						type : 'POST',
						dataType : 'text',
						contentType : 'application/json',
						mimeType : 'application/json',
						success : function(data) {

							console.log("Preference Saved " + data);

						},
						fail : function(data) {

							console.log("error " + data);

						}

					});

				});
				console.log(ko.toJSON(orderList));

				return "leaving page";
			}
		};
	</script>
	<style>
a.disabled {
	color: gray;
	cursor: default;
}

#dateRange {
	cursor: pointer;
}

#dateRange-upcoming {
cursor: pointer;
}

#sortable {
	list-style-type: none;
	width: 100%;
	padding: 0px;
	margin: 0px;
}

#sortable li .panel-heading {
	cursor: move;
}
</style>
</body>
</html>